import { http } from '@/utils/http'

import type { User } from '/@/types/member'
export const getUserInfo = () => {

	return http<User>(
		{
			method: 'GET',
			url: "/app/user/login"
		})
}

export const loginByWechat = (code : string) => {

	return http(
		{
			method: 'GET',
			url: `/app/user/wechatSession/${code}`

		})
}

export const sendEmail = (phone : string) => {

	return http(
		{
			method: 'POST',
			url: `/app/user/sendCode/${phone}`

		})
}
export const loginByPhone = (phone : string, code : string) => {

	return http<User>(
		{
			method: 'POST',
			url: `/app/user/login`,
			data: {
				phone: phone,
				code: code,
			}

		})
}